1. Field of The Invention
The present invention relates generally to computer graphics and animation systems and, more particularly, to graphics rendering hardware.
2. Related Art
Computer graphics systems are commonly used for displaying two- and three-dimensional graphics representations of objects on a two-dimensional video display screen. Current computer graphics systems provide highly detailed representations and are used in a variety of applications.
In a typical computer graphics system, an object or model to be represented on the display screen is broken down into graphics primitives. Primitives are basic components of a graphics display and may include, for example, points, lines, quadrilaterals, triangle strips and polygons. Typically, a hardware/software scheme is implemented to render, or draw, the graphics primitives that represent a view of one or more objects being represented on the display screen.
Generally, the primitives of the three-dimensional object to be rendered are defined by a host computer in terms of primitive data. For example, when the primitive is a triangle, the host computer may define the primitives in terms of the X, Y, Z and W coordinates of its vertices, as well as the red, green and blue and alpha (R, G, B and .alpha.) color values of each vertex. Additional primitive data may be used in specific applications. Rendering hardware interpolates the primitive data to compute the display screen pixels that represent each primitive, and the R, G and B color values for each pixel. As an example, the color values for each pixel may be represented by eight bits each of R, G, B data for a total of twenty-four bits of data per pixel.
The basic components of a computer graphics system typically include a geometry accelerator, a rasterizer and a frame buffer. The system may also include other hardware, such as texture mapping hardware. The geometry accelerator receives from the host computer primitive data that defines the primitives that make up the model view to be displayed. The geometry accelerator performs transformations of coordinate systems on the primitive data and performs such functions as lighting, clipping and plane equation calculations for each primitive. The output of the geometry accelerator, referred to as rendering data, is used by the rasterizer and the texture mapping hardware to generate final screen coordinates and color data for each pixel in each primitive. The pixel data from the rasterizer and the pixel data from the texture mapping hardware, if available, are combined and stored in the frame buffer for display on the video display screen.
Previous frame buffer designs have used a two-port memory device with one port for supplying the rendering pixel data and the other for supplying data for screen refresh. The two ports on the memory device provided the necessary data bandwidth for maintaining system performance requirements. Two-port memory devices are expensive and in an attempt to reduce costs, have been replaced with high-speed single-port memory devices.
When, however, a single-port memory device is used in the frame buffer, memory bandwidth is divided between supplying pixel data for rendering and supplying data for screen refresh. Thus, it can be seen that the overhead operation time of screen refresh impacts rendering performance and if this refresh time can be reduced, performance will be increased.
Consider the case of a system with a single-port memory device where the single port is thirty-two bits wide and twenty-four bits of RGB data is provided for each pixel image along with an eight bit overlay buffer. As is known, in an X-Windows system, one image can be displayed in an overlay plane (about 3/4 of the screen) and another image can be displayed in another plane (the remaining 1/4 of the screen). The overlay buffer provides the data for representing the overlay image. Only one overlay byte is required for each overlay pixel value since this byte is mapped into a lookup table to determine the twenty-four bit color value for the pixel in the overlay plane. In other words, one of 256 possible twenty-four bit color values for each overlay pixel is determined by the overlay byte for that pixel. It is possible, therefore, to manipulate one image without affecting the other. Generally, the system will display the overlay buffer on 3/4 of the screen (overlay plane) and an image represented with the twenty-four bit pixel data on the remaining 1/4 of the screen. Thus, the frame buffer must supply data to a screen refresh unit (SRU) in both an eight bit format and a twenty-four bit format through the single-port of the memory device.
When, however, data is stored in the single-port memory device using the eight-bit format, access to every pixel would utilize only 1/4 of the available bandwidth (8.div.32). Further, if image data were stored in a twenty-four bit format, access to each pixel would still utilize only 3/4 of the available memory bandwidth (24.div.32). Under the best of circumstances, therefore, 25% of the memory device's bandwidth is unused.
Thus, there is a need for a method and apparatus for efficiently storing data in a single-port memory device which provides fast read/write access of the data to provide both rendering pixel data and screen refresh data so as to provide acceptable graphic performance. This device must be able to operate without complex control circuitry and without occupying large amounts of circuit area. Additionally, power consumption must be kept as low as possible.